#include<iostream>
using namespace std;

bool contextstring(int start, int end, char a[], int len)
{
	if (len == 1||len==0)
	{
			return true;
		
	}
	if (a[start] == a[end - 1])
	{
		return contextstring(start +1, end - 1, a, len - 2);
	}
	else
	{
		return false;
	}
	return true;
}
int main()
{
	char a[5] = { 'a','a','b','a','a' };
	int len = sizeof(a) / sizeof(char);
	int start = 0, end = len;
	if (contextstring(start, end, a, len))
	{
		cout << "该字符串是回文字符串" << endl;
		cout << "字符串如下: " << endl;
		for (int i = 0; i < len; i++)
			cout << a[i] << " ";
	}
	else
	{
		cout << "该字符串不是回文字符串" << endl;
		cout << "字符串如下:  " << endl;
		for (int i = 0; i < len; i++)
			cout << a[i] << " ";
	}

		return 0;
}